package app
{
	import data.RSSDATA;
	
	import mx.controls.Tree;
	
	/**
	 * @author thomas fricke
	 * @version 1.0.0
	 * @desc a GoCategoriesTree shows the feed categories in a tree.
	 * */
	 
	public class GoCategoriesTree extends Tree
	{
		
		public var catTree:Tree = new Tree();
		
		public function displayTree():void {
			catTree.x = 10;
			catTree.y = 200;
			catTree.dataProvider = RSSDATA.categories;
			catTree.labelField = "name";
			// catTree.labelFunction = treeLabel(item);
		}
		
            private function treeLabel(item:Object):String {
                var suffix:String = "";
                if (catTree.dataDescriptor.hasChildren(item)) {
                    suffix = " (" + item.children.length + ")";
                }
                return item.name.toUpperCase() + suffix;
            }
		
		public function GoCategoriesTree()
		{
		}

	}
}